<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function sdo(done){
            console.log(done);
        }
        //回调函数就是将一个函数作为另一个函数的参数
        function ldo(doing,callback){
            setTimeout(()=>{
                console.log(doing);
                callback('吃鸡')
            })
        }
        sdo('买鸡');
        sdo("杀鸡");
        ldo("炖鸡",sdo);
        sdo('买调料')
    </script>
</body>
</html>